package com.example.Service;

import com.example.Dao.TableMapper;
import com.example.Pojo.Login;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class TableService {
    @Autowired
    private TableMapper tableMapper;
    public List<Login> getUser(){
        List<Login> list = tableMapper.UserTable();
        list.stream().forEach(login -> System.out.println(list));
        return list;
    }
    public int deleteUser(int id){
        try {
            tableMapper.deleteUser(id);
            return 1;
        } catch (Exception e) {
            return 0;
        }
    }
}
